The electronic device may sense various information from a surrounding environment of the electronic device using a sensor. The electronic device may recognize various motions and gestures of a subject using an image sensor. For example, an electronic device including a depth sensor (e.g., a depth camera) may acquire not only information of a (x, y) pixel, but also depth data (e.g., a depth map) between the electronic device and the subject. The depth data may be information indicating a distance between the electronic device (e.g., an image sensor) and the subject.